﻿using System.Collections;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace RSSReader
{
    [XmlRoot("RSSTitlesToMatch", Namespace = "RSSTitlesToMatch", IsNullable = false)]
    public class RSSTitlesToMatch : IEnumerable<RSSTitleToMatch>
    {
        public List<RSSTitleToMatch> Titles { get; set; }

        public void AddFeed(RSSTitleToMatch titleToMatch)
        {
            Titles.Add(titleToMatch);
        }

        public RSSTitlesToMatch()
        {
            Titles = new List<RSSTitleToMatch>();
        }


        public IEnumerator<RSSTitleToMatch> GetEnumerator()
        {
            return Titles.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public void Add(object title)
        {
            Titles.Add((RSSTitleToMatch)title);
        }

    }

    public class RSSTitleToMatch
    {
        public string Title { get; set; }
        public bool IsMovie { get; set; }
        public string Quality { get; set; }

        private void Init()
        {
        }

        public RSSTitleToMatch(string title, bool isMovie, string quality)
        {
            Init();
            Title = title;
            IsMovie = isMovie;
            Quality = quality;
        }

        public RSSTitleToMatch()
        {
            Init();
        }

    }
}
